package 笔试.字节;

import com.sun.xml.internal.bind.v2.model.core.ID;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author:谢君臣
 * @Date:2021/10/10-10:16
 * @version:1.0
 * @function: 可组成的数字 0   1   2   3   4   5   6   7   8   9
 * 所需火柴数量            6   2   5   5   4   5   6   3   7   6
 */
public class Main1010 {
    static int count=0;
    public static void main(String[] args) {
        f(f(9));
    }

    private static String maxNum(int m) {
        StringBuilder res = new StringBuilder();
        int k = m / 2;
        while (k > 0) {
            res.append(1);
            k--;
        }
        if (m % 2 > 0) {
            res.substring(1);
            return "7" + res.toString();
        }
        return res.toString();
    }
    private static String minNum(int m) {
        StringBuilder res = new StringBuilder();
        int n = 8;
        if (m > n) n = m + 1;
        String[] dp = new String[n];
        dp[2] = "1";dp[3] = "7";dp[4] = "4";
        dp[5] = "2";dp[6] = "0";dp[7] = "8";
        int i = 8;
        while (i <= m) {
            int a = Integer.parseInt(dp[2]+dp[i - 2]);
            int b = Integer.parseInt(dp[i - 2]+dp[2]);
            int min = Math.min(a,b);
            if (dp[i - 2].equals("0")|| dp[2].equals("0"))min=Math.max(a,b);
            for (int j = 3; j <= i / 2; j++) {
                int temp1 = Integer.parseInt(dp[j]+dp[i - j]);
                int temp2 = Integer.parseInt(dp[i - j]+dp[j]);
                int temp = Math.min(temp1,temp2);
                if (dp[i - j] .equals("0") || dp[j].equals("0"))temp=Math.max(temp1,temp2);
                min = Math.min(min, temp);
            }
            dp[i] = String.valueOf(min);
            i++;
        }
        return String.valueOf(dp[m]);
    }
    static int f(int n){
        count++;
        System.out.println(count);
        if (n<=3) {
            return 1;
        }else
            return f(n-2)+f(n-6)+1;
    }
}
